<%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/token.jsp"%>
<%!
	// 确认详情
	String list(Input input) {
		Message msg = new Message();
		Integer id = input.getInt("id", 0); 
		Integer hospital = input.getInt("hospital", 0); 
		List<Map> receiverList = QBuilder.db("basedb").select("new map(nc.nid as nid, up.uid as uid, up.name as name, nc.isConfirmed as is_confirmed ,u.avatar as avatar, u.gender as gender)").from("NotificationConfirm as nc, UserProfile as up, User as u").where(new Where("nc.nid=", id).and("nc.uid=up.uid").and("up.self=", SELF).and("nc.status=", STATUS_ENABLE).and("u.id=up.uid").and("u.hospital=", hospital).and("nc.hospital=", hospital).and("up.hospital=", hospital)).query().getResultObj();;
		Map<String, List<Map>> userMap = new HashMap<String, List<Map>>();
		List<Map> isConfirmed = new ArrayList<Map>();
		List<Map> noConfirmed = new ArrayList<Map>();
		for (Map map:receiverList) {
			if ((Integer)map.get("is_confirmed") == 0)
				noConfirmed.add(map);
			else 
				isConfirmed.add(map);
		}
		userMap.put("is_confirmed", isConfirmed);
		userMap.put("no_confirmed", noConfirmed);
		msg.put("data", userMap);
		return msg.toJson();
	}
%>
<%
	Tools.encryptPrint(out, list(input));
%>
